<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>VarnishAdmin constructor</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="varnishadmin.connect.html">« VarnishAdmin::connect</a></li>
      <li style="float: right;"><a href="varnishadmin.disconnect.html">VarnishAdmin::disconnect »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.varnishadmin.html">VarnishAdmin</a></li>
    <li>VarnishAdmin constructor</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="varnishadmin.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">VarnishAdmin::__construct</h1>
  <p class="verinfo">(PECL varnish &gt;= 0.3)</p><p class="refpurpose"><span class="refname">VarnishAdmin::__construct</span> &mdash; <span class="dc-title">VarnishAdmin constructor</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-varnishadmin.construct-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>VarnishAdmin::__construct</strong></span>(<span class="methodparam"><span class="type">array</span> <code class="parameter">$args</code><span class="initializer"> = ?</span></span>)</div>

  <p class="para rdfs-comment">

  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-varnishadmin.construct-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">args</code></dt>

    <dd>

     <p class="para">
       Configuration arguments. The possible keys are:
<div class="parameterscode"><pre class="parameterscode">VARNISH_CONFIG_IDENT - local varnish instance ident
VARNISH_CONFIG_HOST - varnish instance ip
VARNISH_CONFIG_PORT - varnish instance port
VARNISH_CONFIG_SECRET - varnish instance secret
VARNISH_CONFIG_TIMEOUT - connection read timeout
VARNISH_CONFIG_COMPAT - varnish major version compatibility</pre>
</div>
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-varnishadmin.construct-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-varnishadmin.construct-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-4582">
   <p><strong>示例 #1 <span class="function"><strong>VarnishAdmin::__construct()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;$args&nbsp;</span><span style="color: #007700">=&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">VARNISH_CONFIG_HOST&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"::1"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">VARNISH_CONFIG_PORT&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">6082</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">VARNISH_CONFIG_SECRET&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"5174826b-8595-4958-aa7a-0609632ad7ca"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">VARNISH_CONFIG_TIMEOUT&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">300</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$va&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">VarnishAdmin</span><span style="color: #007700">(</span><span style="color: #0000BB">$args</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

  </div>
 </div>


</div></div></div></body></html>